﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.装饰器
{
    /// <summary>
    /// 3. 订单装饰器 - 抽象装饰器
    /// </summary>
    public abstract class OrderDecorator : IOrder
    {
        protected IOrder _order;

        // 注意，这里的引入是整个模式的灵魂
        protected OrderDecorator(IOrder order)
        {
            _order = order;
        }

        public virtual double CalculateTotal()
        {
            return _order.CalculateTotal();
        }
    }
}
